package Regex;

import java.util.Scanner;

public class RegexDemo3 {
    public static void main(String[] args) {
        /*需求
        请编写正则表达式验证用户输入的手机号码是否满足要求。请编写正则表达式验证用户输入的邮箱号是否满足要求。请编写正则表达式验证用户输入的电话号码是否满足要求。
        验证手机号码              13112345678   13712345667   13945679027    139456790271
        验证座机电话号码           020-2324242  02122442   027-42424   (0712-3242434)
        验证邮箱号码              3232323@qq.com zhangsan@itcast.cnn dlei0009@163.com dlei00e9@pci.com.cn
        */

        String Tel = new String();
        String Ztel = new String();
        String Yx = new String();

        Scanner sc = new Scanner(System.in);

        Tel = sc.nextLine();
        Ztel = sc.nextLine();
        Yx = sc.nextLine();

        System.out.println(Tel.matches("1[3-9]\\d{9}"));
        System.out.println("----------------------------------");
        System.out.println(Ztel.matches("0\\d{2,3}-?[1-9]\\d{4,9}"));
        System.out.println("----------------------------------");
        System.out.println(Yx.matches("\\w+@[\\w&&[^_]]{2,6}(\\.[a-zA-Z]{2,3}){1,2}"));

        String regex = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
        System.out.println("++ 0==" + Tel.matches(regex));

    }
}
